<template>
	<!-- <view class="audit-container"> -->
	<view>
		<pageAduit
			:pageUrl="pageUrl"
			:salesContractData="salesContractData"
			:formFields="formFields"
			:formOptions="formOptions"
			:detailColumns="detailColumns"
			@masterDate="masterDate"
		></pageAduit>
	</view>
</template>

<script>
export default {
	data() {
		return {
			pageUrl: 'q_after_delivery',
			salesContractData: {
				workTable: 'workTable',
				tableKey: 'tableKey'
			},
			//4、配置当前表要显示的字段
			formFields: {
				Voucher_sub: '',
				Sales_sub: '',
				Client_name: '',
				Goods_num: '',
				Total_price: '',
				Tax_rate: '',
				WHSE_no: '',
				Attachment: '',
				Image: '',
				Remark: '',
			},
			//5、配置当前显示表单参数，可以直接从生成的SellOrderOptions.js页面将editFormFields与editFormOptions复制过来
			formOptions: [
				{
					title: 'ID',
					required: true,
					field: 'After_delivery',
					hidden: true,
					readonly: true
				},
				{
					title: '订单编码',
					field: 'Voucher_sub',
					readonly: true
				},{
					title: '销售单',
					field: 'Sales_sub',
					readonly: true
				},
				{
					title: '客户',
					field: 'Client_name',
					readonly: true,
					data: [],
					key: '审核通过客户'
				},
				{
					title: '数量',
					field: 'Goods_num',
					readonly: true,
					type: 'number'
				},
				
				{
					title: '发货机构',
					field: 'WHSE_no',
					readonly: true,
					data: [],
					key: '库位编码'
				},
				{
					title: '备注',
					field: 'Remark',
					readonly: true
				}
			],
			detailColumns: [
				{
					field: 'After_deliveryList',
					title: 'ID',
					hidden: true
				},
				{
					field: 'Goods_sub',
					title: '商品',
					require: true,
					bind: {
						key: '商品',
						data: []
					},
					type: 'select',
				},
				// {
				// 	field: 'Goods_name',
				// 	title: '商品名称',
				// 	type: 'string',
				// 	readonly: true
				// },
				{
					field: 'Goods_size',
					title: '规格型号',
					readonly: true
				},
				{
					field: 'Goods_num',
					title: '数量',
					readonly: true
				}
			]
		};
	},
	methods: {
		masterDate(val) {
			Object.assign(this.formFields, val);
		}
	},
	onLoad(options) {
		console.log('options', options);
		this.salesContractData = {
			workTable: options.workTable,
			tableKey: options.tableKey
		};
	}
};
</script>

<style lang="less" scoped>
.audit-container {
	position: absolute;
	height: 100%;
	width: 100%;
	overflow-y: scroll;
	background: #f9f9f9;
	padding: 20rpx;
	box-sizing: border-box;

	.audit-form,
	.audit-action {
		border-radius: 5px;
		background: #ffff;
	}
}
</style>
